home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / MiscFile+Searching.h < prev    next >
Encoding:
Text File  |  1995-01-26  |  1.9 KB  |  55 lines

  1. /************************************************************************
  2.   CATEGORY:            MiscFile (Searching)
  3.   PROGRAMMER:        Todd Thomas, Copyright 1994, 1995.
  4.   BEGAN:            December 22, 1994
  5.   LAST CHANGED:        January 25, 1995
  6.   CHANGES:            -
  7.   VERSION:            0.2
  8.   DECLARED IN:        <misckit/MiscFile.h>
  9.   
  10.   Adds the capability of searching an instance of MiscFile for specific 
  11.   filenames. Probably not all that efficient, but it does work. It is 
  12.   also very flexible since it consults the class delegate to see if each
  13.   file should be added to the returned list.
  14.  
  15.   This object is included in the MiscKit by permission from the author
  16.   and its use is governed by the MiscKit license, found in the file
  17.   "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  18.   for a list of all applicable permissions and restrictions.
  19.           
  20.  *************************************************************************/
  21.  
  22.  
  23. @interface MiscFile (Searching) 
  24.  
  25. // Used for searching through MiscFiles and their children to match the 
  26. // given filename. If a match is found, a MiscFile representing the 
  27. // filename is returned, else nil.
  28.  
  29. - (MiscFile *)searchFor: (const char *)filename;
  30. - (MiscFile *)searchFor: (const char *)filename recursive: (BOOL)recursive; 
  31. - (MiscFile *)searchFor: (const char *)filename recursive: (BOOL)recursive 
  32.     followLinks: (BOOL)followLinks;
  33.  
  34. // Methods for searching a MiscFile and it's children while consulting the
  35. // class delegate on whether the MiscFile should be added to the List that
  36. // will be returned.
  37.  
  38. - (List *)searchFiles;
  39. - (List *)searchFilesAndRecurse: (BOOL)recursive;
  40. - (List *)searchFilesAndRecurse: (BOOL)recursive 
  41.     followLinks: (BOOL)followLinks;
  42.  
  43. @end
  44.  
  45.  
  46. @interface Object (MiscFileSearchingDelegate)
  47.  
  48. // The class delegate (if there is one) can implement this method
  49. // to decide which files should be chosen when using the searchFiles*
  50. // methods
  51. - (BOOL)addFile: (MiscFile *) theFile;
  52.  
  53. @end
  54.  
  55.